﻿<UserControl x:Class="ForumsBrowser.ThreadTooltip"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:fb="clr-namespace:ForumsBrowser">
    <StackPanel MaxWidth="450">
        <TextBlock Margin="3,0,3,0" Text="{Binding Title, FallbackValue=Hi this is the title of this whole thing }" FontSize="15" TextWrapping="Wrap" Foreground="Black" FontWeight="Bold"/>
        <Line X2="5"  HorizontalAlignment="Stretch" Stretch="Fill" Height="5" StrokeThickness="1" Stroke="Black"/>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <fb:ImageToken ImageUrl="{Binding LastMessageBy.Image}" Height="50" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            <StackPanel Grid.Column="1">
                 <TextBlock Margin="3,0,3,0" Text="{Binding ForumName}" Foreground="Black" FontStyle="Italic"/>
                <TextBlock Margin="3,0,3,0" Foreground="Black">
                    <TextBlock.Text>
                        <MultiBinding StringFormat="{}Replies: {0} Views: {1}">
                            <Binding Path="Replies"/>
                            <Binding Path="Views"/>
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
                <TextBlock Margin="3,0,3,0" Foreground="Black">
                    <TextBlock.Text>
                        <MultiBinding StringFormat="{}Author: {0}">
                            <Binding Path="Author.DisplayName"/>
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
                <TextBlock Margin="3,0,3,0" Foreground="Black" TextTrimming="CharacterEllipsis" >
                    <TextBlock.Text>
                        <MultiBinding StringFormat="{}Last Reply by {0}">
                            <Binding Path="LastMessageBy.DisplayName"/>
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>  
            </StackPanel>
        </Grid>

        <Border BorderBrush="Black" BorderThickness="1" CornerRadius="3" Margin="2,10,2,2" Padding="3">
            <TextBlock MaxHeight="250" Foreground="Black"
                       TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis">
                <TextBlock.Text>
                    <MultiBinding StringFormat="{}{0}">
                        <Binding Path="LastMessageText"/>
                    </MultiBinding>
                </TextBlock.Text>
            </TextBlock>
        </Border>
    </StackPanel>
</UserControl>
